FROM centos:7
MAINTAINER JiaLing.fan <fanjialing@126.com>


#以下设置中文语言环境与修改时区
ENV LANG=zh_CN.UTF-8 \
	LANGUAGE=zh_CN:zh \
	LC_ALL=zh_CN.UTF-8

COPY jdk1.8.0_171 ./opt/jdk1.8.0_171
ENV JAVA_HOME=/opt/jdk1.8.0_171
ENV PATH=$JAVA_HOME/bin:$PATH
ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
RUN yum reinstall -y glibc-common
RUN yum install -y telnet net-tools
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8

ADD chinese.tar.gz /usr/share/fonts/


ADD LibreOffice_7.6.7_Linux_x86-64_rpm.tar.gz /home/
ADD LibreOffice_7.6.7_Linux_x86-64_rpm_langpack_zh-CN.tar.gz /usr/


RUN cd /home/LibreOffice_7.6.7.2_Linux_x86-64_rpm/RPMS/ \
	&& yum localinstall *.rpm -y \
	&& cd /usr/LibreOffice_7.6.7.2_Linux_x86-64_rpm_langpack_zh-CN/RPMS/   \
	&& yum localinstall *.rpm -y \
	&& yum install ibus -y \
	&& cd /usr/share/fonts/ \
	&& chmod -R 755 /usr/share/fonts \
	&& yum install mkfontscale -y \
	&& mkfontscale \
	&& yum install fontconfig -y \
	&& mkfontdir \
	&& fc-cache -fv \
	&& mkdir /usr/local/java/ \
	&& yum clean all



WORKDIR /opt
cmd /bin/bash
VOLUME /tmp
ADD root.jar /opt/root.jar
ENV JAVA_OPTS="-server -Xms2048m -Xmx2048m"
ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom   -Dfile.encoding=UTF8 -Dsun.jnu.encoding=UTF8 -jar /opt/root.jar
